#ifndef _ERROR_H_
#define _ERROR_H_

#define RET_OK              0x0000
#define RET_FAIL            0x0001
#define RET_ENROLL_OK       0x0002

#define ERR_NULL_POINTER    0x9000
#define ERR_TIME_OUT        0x9001      //超时
#define ERR_NOT_SUPPORT     0x9002      //不支持

#define ERR_READ_FLASH      0x9101      //读flash错误
#define ERR_WRITE_FLASH     0x9102      //写flash失败
#define ERR_INVALID_PARA    0x9103      //参数编号无效
#define ERR_INVALID_DATA    0x9104      //数据编号无效
#define ERR_OVER_RANGE      0x9105      //超过最大ID范围
#define ERR_NO_CAPTURE      0x9106      //未采图
#define ERR_NO_FEATURE      0x9107      //未特征提取

#define ERR_INIT_SENSOR     0x9201      //初始化sensor
#define ERR_INIT_FP         0x9202      //初始化7006
#define ERR_INIT_FLASH      0x9203      //初始化flash
#define ERR_CHECK_RAM       0x9204      //Ram检测
#define ERR_CHECK_FLASH     0x9205      //Flash检测
#define ERR_CHECK_7006      0x9206      //7006检测
#define ERR_CHECK_SENSOR    0x9207      //Sensor检测

#define ERR_IMG_FAIL        0x9300      //采图失败
#define ERR_IMG_SMALL       0x9301      //图片太小
#define ERR_IMG_GRAY        0x9302      //图片太灰
#define ERR_IMG_BLACK       0x9303      //图片太黑
#define ERR_IMG_WET         0x9304      //图片太湿
#define ERR_IMG_DRY         0x9305      //图片太干,差图
#define ERR_IMG_FAKE        0x9306      //假手指

#define ERR_FEATURE_LESS    0x9401      //特征点少
#define ERR_FEATURE_MORE    0x9402      //特征点多
#define ERR_FEATURE_OVER    0x9403      //FIFO溢出（）

#define ERR_REG_FULL        0x9501      //注册ID满
#define ERR_REG_EXIST       0x9502      //注册ID存在

#define ERR_UPDATE          0x9601      //更新失败
#define ERR_SEARCH          0x9602      //搜索失败（没有ID注册情况）

#define ERR_PASSWORD        0x9701      //密码有误
#define ERR_RAND_ID         0x9702      //随机ID生成失败

#define ERR_FP_EXIST        0x9801      //指纹模块非空
#define ERR_FP_NONE         0x9802      //指纹模块为空

#define ERR_INVALID_REG     0x9901      //无效寄存器号
#define ERR_REG_PARA        0x9902      //寄存器参数错误


#define ERROR_FP            0x8000    //错误标识

#define ERROR_XOR           0x8F01    //XOR校验错误
#define ERROR_SUM           0x8F02    //SUM校验错误
#define ERROR_CMD           0x8F03    //指令错误
#define ERROR_PAR           0x8F04    //参数错误
#define ERROR_TIME          0x8F05    //通信超时
#define ERROR_NO_PAR        0x8F06    //无系统文件
#define ERROR_SYS           0x8F07    //系统错误
#define ERROR_VDD1          0x8F09    //电压当前过低
#define ERROR_VDD2          0x8F0a    //电压出现过异常
#define ERROR_FLASH         0x8F0b    //FLASH操作错误

#define FAIL_INITIAL        0x8101    //传感器初始化失败
#define FAIL_CALIB          0x8102    //校准传感器失败

#define FAIL_DETECT_FINGER  0x8201    //手指检测错误
#define FAIL_CAPTURE        0x8202    //图象采集失败
#define FAIL_CREATE_TMP     0x8203    //模板生成错误
#define FAIL_FINGER_OFF     0x8205    //FINGER UP

#define FAIL_BE_ENROLLED    0x8301    //已注册
#define FAIL_MATCH_TMP1     0x8302    //与临时模板1匹配失败
#define FAIL_MATCH_TMP2     0x8303    //与临时模板2匹配失败
#define FAIL_TMP_FULL       0x8304    //注册已满
#define FAIL_ENROLL_1       0x8311    //请勿移动过大
#define FAIL_ENROLL_2       0x8312    //请稍稍移动

#define FAIL_NO_TMP         0x8401    //无注册指纹
#define FAIL_MATCH          0x8402    //与主模板匹配失败
#define FAIL_MATCH_SUB      0x8403    //与副模板匹配失败
#define FAIL_RESIDUAL       0x8404    //判断为残留模板

#define FAIL_DELTE          0x8501    //删除模板失败

#define FAIL_TEST_CURRENT   0x8610    //测试电路失败
#define FAIL_TEST_REG       0x8620    //测试寄存器失败
#define FAIL_TEST_RESET     0x8630    //测试复位失败
#define FAIL_TEST_INT       0x8640    //测试中断失败
#define FAIL_TEST_INT_SOFT  0x8641    //测试软复位失败
#define FAIL_TEST_RAM       0x8650    //测试RAM失败
#define FAIL_TEST_FLASHID   0x8660    //测试Flash ID失败
#define FAIL_TEST_FLASH4X   0x8670    //测试Flash 4x失败
#define FAIL_TEST_MATCH     0x8680    //测试比对失败
#define FAIL_TEST_MATCH_REG 0x8681    //测试比对注册失败
#define FAIL_TEST_MATCH_AFM 0x8682    //测试AFM失败
#define FAIL_TEST_MATCH_AFW 0x8683    //测试AFW失败
#define FAIL_TEST_MATCH_PLL 0x8684    //测试锁相失败
#define FAIL_TEST_MATCH_IO  0x8685    //测试IO失败
#define FAIL_TEST_MBIST     0x8690    //测试MBIST失败
#define FAIL_TEST_TIMEOUT   0x86A0    //测试总时间失败

#define FAIL_TEST_READLOG   0x86E0    //读取测试日志失败

#define FAIL_CMOS_TEST      0x8801    //CMOS测试标准图像失败

#endif
